home *** CD-ROM | disk | FTP | other *** search
/ Windows Expert / Windows Expert.iso / windownt / perlnt.zip / t / op / time.nt < prev    next >
Text File  |  1993-07-25  |  824b  |  37 lines

  1. #!./perl
  2.  
  3. # $Header: time.t,v 4.0 91/03/20 01:55:09 lwall Locked $
  4.  
  5. print "1..4\n";
  6.  
  7. ($beguser,$begsys) = times;
  8.  
  9. $beg = time;
  10.  
  11. while (($now = time) == $beg) {}
  12.  
  13. if ($now > $beg && $now - $beg < 10){print "ok 1\n";} else {print "not ok 1\n";}
  14.  
  15. ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($beg);
  16. ($xsec,$foo) = localtime($now);
  17. $localyday = $yday;
  18.  
  19. if ($sec != $xsec && $mday && $year)
  20.     {print "ok 2\n";}
  21. else
  22.     {print "not ok 2\n";}
  23.  
  24. ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime($beg);
  25. ($xsec,$foo) = localtime($now);
  26.  
  27. if ($sec != $xsec && $mday && $year)
  28.     {print "ok 3\n";}
  29. else
  30.     {print "not ok 3\n";}
  31.  
  32. if (index(" :0:1:-1:365:366:-365:-366:",':' . ($localyday - $yday) . ':') > 0)
  33.     {print "ok 4\n";}
  34. else
  35.     {print "not ok 4\n";}
  36.  
  37.